<!-- File: /app/views/posts/index.ctp -->
<div id="icon-edit" class="icon32"><br /></div>
<h2>Surat HRD
<?php //echo $html->link('Add New',array('controller'=>'hrdsurats','action'=>'add'),array('class'=>'button add-new-h2')); ?>
<?php //echo $html->link('Preview',array('controller'=>'hrdsurats','action'=>'preview'),array('class'=>'button add-new-h2','target'=>'_blank')); ?>
<?=anchor('hrdsurat/add/'.$kap,'Add New '.strtoupper($kap),array('class'=>'button add-new-h2'));?>
<?=anchor('hrdsurat/excel','Transfer Excel',array('class'=>'button add-new-h2'));?>
</h2>


<?php //echo $form->create('Hrdsurats',array('controller'=>'hrdsurats','action'=>'index')); ?>

<!--
<ul class="subsubsub">
<li><a href='edit.php?post_type=post' class="current">All <span class="count">(2)</span></a> |</li>
<li><a href='edit.php?post_status=publish&amp;post_type=post'>Published <span class="count">(2)</span></a></li>
</ul>
-->

<p></p>
<?=form_open('hrdsurat/action/');?>
<p class="search-box">
<?php if(($this->session->userdata('no_hrdsurat')=='') AND ($this->session->userdata('klien_hrdsurat')=='') ) :?>
	 No Surat
	<input type="text" id="post-search-input" name="no" value="" />
	 Nama Karyawan
	<input type="text" id="post-search-input" name="s" value="" />	
	<input type="submit" value="Search" name="search" class="button" />
<?php else:?>
	<input type="submit" value="Reset" name="reset" class="button" />
<?php endif;?>	
</p>
<?=form_close();?>
<br/>
<p></p>


<div class="tablenav">

<?=form_open('hrdsurat/date/');?>
<div class="alignleft actions">
<!--
<select name="action">
<option value="-1" selected="selected">Bulk Actions</option>
<option value="edit">Edit</option>
<option value="trash">Move to Trash</option>
</select>
<input type="submit" value="Apply" name="doaction" id="doaction" class="button-secondary action" />
<input type="hidden" id="_wpnonce" name="_wpnonce" value="320265c495" /><input type="hidden" name="_wp_http_referer" value="/wordpress/wp-admin/edit.php" />
-->
<?php if($this->session->userdata('tgl_hrdsurat_awal')==''):?>
Dari
<select name='dd'>
<?php for($i=1;$i<=31;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='mm'>
<?php for($i=1;$i<=12;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='yyyy'>
<?php for($i=2010;$i<=2012;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

s/d
<select name='dd2'>
<?php for($i=1;$i<=31;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='mm2'>
<?php for($i=1;$i<=12;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='yyyy2'>
<?php for($i=2010;$i<=2012;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<input type="submit" name="search" id="post-query-submit" value="Search" class="button-secondary" />
<?php else:?>
<input type="submit" name="reset" id="post-query-submit" value="Reset" class="button-secondary" />
<?php endif;?>
</div>
<?=form_close();?>


<!--<div class="view-switch">
	<a href="/wordpress/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://localhost/wordpress/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" /></a>
	<a href="/wordpress/wp-admin/edit.php?mode=excerpt"><img  id="view-switch-excerpt" src="http://localhost/wordpress/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" /></a>
</div>-->

<div class="clear"></div>
</div>

<div class="clear"></div>

<table class="widefat post fixed" cellspacing="0">
	<!-- Head -->
    <thead>
	<tr>
	<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
	<th scope="col" id="title" >No.Surat</th>
	<th scope="col" id="title" >Type</th>
	<th scope="col" id="author" >Tanggal</th>
	<th scope="col" id="categories">Nama Karyawan</th>
	<th scope="col" id="tags">Alamat</th>
	<th scope="col" id="date">Keterangan</th>
    <th scope="col" id="rem"></th>
	</tr>
	</thead>
   <!-- Head -->
   <!-- Footer -->
	<tfoot>
	<tr>
	<th scope="col"><input type="checkbox" /></th>
	<th scope="col">No.Surat</th>
    <th scope="col">Type</th>
	<th scope="col">Tanggal</th>
	<th scope="col">Nama Karyawan</th>
	<th scope="col">Alamat</th>
	<th scope="col">Keterangan</th>
    <th scope="col"></th>
	</tr>
	</tfoot>
    <!-- Footer -->

	<tbody>
	<?php if(count($hrdsurats)>0):?>
	<?php foreach ($hrdsurats as $rec): ?>
    <tr id='post-4' class='alternate author-self status-publish iedit' valign="top">
    <td><a href="#">#</td>
    <td><a href="#"><?=$rec['no_surat']; ?></a></td>
	<td><a href="#"><?=$rec['type']; ?></a></td>
    <td><a href="#"><?=$rec['tgl']; ?></a></td>
    <td><a href='#'><?=$rec['name']; ?></a></td>
    <td><?=$rec['address']; ?></td>
    <td><?=$rec['desc']; ?></td>
    <td><br />
	<?php //if(date("Y-m-d") == $rec['tgl'] ): ?>
	<?=anchor('hrdsurat/edit/'.$rec['id'].'/'.$kap,'Edit HRD',array('class'=>'button add-new-h2')); ?><p></p>
	<?=anchor('hrdsurat/remove/'.$rec['id'],'Remove',array('class'=>'button add-new-h2'))?>
	<?php // echo $html->link('Remove',array('controller'=>'hrdsurats','action'=>'remove/'.$rec['Hrdsurat']['id']),array('class'=>'button add-new-h2')); ?>
	<?php //endif; ?>
	</td>	     
   </tr>
   <?php endforeach; ?> 
   <?php endif;?>
	</tbody>
</table>

<?php // echo $this->element('paging'); ?>


</form>

